package com.alibaba.citrus.cr.mn.order.center.autofulfillmentorder.service.impl;

import com.alibaba.citrus.cr.mn.order.center.autofulfillmentorder.service.AutoFulfillmentOrderBizWriteService;
import com.alibaba.cz.base.tool.log.Log;
import com.epoch.app.crforecastsales.domian.cfsbcautofulfillmentorderrecords.dto.Create2Response;
import com.epoch.app.crforecastsales.domian.cfsbcautofulfillmentorderrecords.dto.Update2Response;
import com.epoch.app.crforecastsales.domian.cfsbcautofulfillmentorderrecords.model.CfsBcAutoFulfillmentOrderRecords;
import com.epoch.app.crforecastsales.domian.cfsbcautofulfillmentorderrecords.service.CfsBcAutoFulfillmentOrderRecordsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author baizhuo
 * @version 1.0
 * @date 2023/8/21 16:45
 */
@Service
public class AutoFulfillmentOrderBizWriteServiceImpl implements AutoFulfillmentOrderBizWriteService {

    private static final Log log = Log.getLogger(AutoFulfillmentOrderBizWriteService.class);

    @Resource
    private CfsBcAutoFulfillmentOrderRecordsService cfsBcAutoFulfillmentOrderRecordsService;

    @Override
    public int create(CfsBcAutoFulfillmentOrderRecords cfsBcAutoFulfillmentOrderRecords) {
        Create2Response create2Response = cfsBcAutoFulfillmentOrderRecordsService.create2(cfsBcAutoFulfillmentOrderRecords);
        return Integer.valueOf(create2Response.getLastInsertId());
    }

    @Override
    public int update(CfsBcAutoFulfillmentOrderRecords cfsBcAutoFulfillmentOrderRecords) {
        Update2Response updateResponse = cfsBcAutoFulfillmentOrderRecordsService.update2(cfsBcAutoFulfillmentOrderRecords);
        return updateResponse.getCount();
    }
}
